repo.or.cz
/
and.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Waterloo ACM Programming Contest Fall 2
[and.git]
/
568 - Just the facts
/
568.cpp
blob
d0b4fc997a63a3570b004d61216f594a9a232d08
1
#include <stdio.h>
2
3
4
int
main
(){
5
int
f
[
10001
];
6
f
[
1
] =
1
;
7
for
(
int
i
=
2
;
i
<=
10000
; ++
i
){
8
f
[
i
] =
f
[
i
-
1
]*
i
;
9
while
(
f
[
i
]%
10
==
0
)
f
[
i
] /=
10
;
10
f
[
i
] %=
100000
;
11
//printf("f[%d] es %d\n", i, f[i]);
12
}
13
14
int
n
;
15
while
(
scanf
(
"%d"
, &
n
) ==
1
){
16
printf
(
"%5d -> %d
\n
"
,
n
,
f
[
n
]%
10
);
17
}
18
return
0
;
19
}